<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./js/vue.js"></script>
   
    <div id="app">
        <button :disabled="flag">{{msg}} {{num}}S</button>
    </div>
    <script>
        var app = new Vue({
            el:"#app",
            data:{
             msg:'确定',
             flag:'true',
             num:10 
            },
            mounted () {
                this.mynum=setInterval(()=>{
                    console.log(this.$data.num);
                    this.num = --this.num
                    // console.log(this.num);
                    if(this.num<=0){
                        this.flag=false
                        console.log(this.flag);
                        clearInterval(this.mynum)
                    }
                },1000)
            }
        })
    </script>
    
</body>
</html>